package initialize

import (
	"log"
	"template/server/http/global"

	"github.com/spf13/viper"
)

func ReadConfig(configFilePath string) (err error) {
	viper.SetConfigFile(configFilePath)
	err = viper.ReadInConfig()
	if err != nil {
		return err
	}
	err = viper.Unmarshal(&global.Config)
	if err != nil {
		log.Println(err)
		return err
	}
	return nil
}
